home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).adf / Include / Intuition.i < prev    next >
Text File  |  1989-07-02  |  10KB  |  412 lines

  1.  
  2. {
  3.     Intuition.i for PCQ Pascal
  4.  
  5.     This is some of the information you'll need to work with
  6. Intuition from PCQ.  I included most of the easy stuff having to do with
  7. windows and screens, but there is a lot more to go.
  8.     While we're at it, I'll mention that you do not need to open the
  9. Intuition library yourself.  The startup code needs the library and
  10. opens it, so these routines use that pointer.
  11. }
  12.  
  13. {$I "Include/Ports.i"}
  14.  
  15. const
  16.     SIZEVERIFY_f    = $0001;    { As the tag _f would incdicate,  }
  17.     NEWSIZE_f        = $0002;    { These are some of the Intuition }
  18.     REFRESHWINDOW_f    = $0004;    { flags.  I apologise for having  }
  19.     MOUSEBUTTONS_f    = $0008;    { to include that inconvenient    }
  20.     MOUSEMOVE_f        = $0010;    { little tag, but otherwise these }
  21.     GADGETDOWN_f    = $0020;    { get confused with Procedure and }
  22.     GADGETUP_f        = $0040;    { Function names.          }
  23.     REQSET_f        = $0080;
  24.     MENUPICK_f        = $0100;
  25.     CLOSEWINDOW_f    = $0200;
  26.     RAWKEY_f        = $0400;
  27.     REQVERIFY_f        = $0800;
  28.     REQCLEAR_f        = $1000;
  29.     MENUVERIFY_f    = $2000;
  30.     NEWPREFS_f        = $4000;
  31.     DISKINSERTED_f    = $8000;
  32.     DISKREMOVED_f    = $10000;
  33.     WBENCHMESSAGE_f    = $20000;
  34.     ACTIVEWINDOW_f    = $40000;
  35.     INACTIVEWINDOW_f    = $80000;
  36.     DELTAMOVE_f        = $100000;
  37.     VANILLAKEYS_f    = $200000;
  38.     INTUITICKS_f    = $400000;
  39.     LONELYMESSAGE_f    = $80000000;
  40.  
  41.     WBENCHSCREEN_f    = 1;
  42.     CUSTOMSCREEN_f    = 15;
  43.  
  44.     WINDOWSIZING_f    = $0001;
  45.     WINDOWDRAG_f    = $0002;
  46.     WINDOWDEPTH_f    = $0004;
  47.     WINDOWCLOSE_f    = $0008;
  48.     SIZEBRIGHT_f    = $0010;
  49.     SIZEBBOTTOM_f    = $0020;
  50.     SMART_REFRESH_f    = 0;
  51.     SIMPLE_REFRESH_f    = $0040;
  52.     SUPER_BITMAP_f    = $0080;
  53.     OTHER_REFRESH_f    = $00c0;
  54.     BACKDROP_f        = $0100;
  55.     REPORTMOUSE_f    = $0200;
  56.     GIMMEZEROZERO_f    = $0400;
  57.     BORDERLESS_f    = $0800;
  58.     ACTIVATE_f        = $1000;
  59.  
  60.     SELECTUP        = $E8;
  61.     SELECTDOWN        = $68;
  62.     MENUUP        = $E9;
  63.     MENUDOWN        = $69;
  64.     ALTLEFT        = $10;
  65.     ALTRIGHT        = $20;
  66.     AMIGALEFT        = $40;
  67.     AMIGARIGHT        = $80;
  68.     AMIGAKEYS        = $C0;
  69.  
  70.     CURSORUP        = $4C;
  71.     CURSORLEFT        = $4F;
  72.     CURSORRIGHT        = $4E;
  73.     CURSORDOWN        = $4D;
  74.     KEYCODE_Q        = $10;
  75.     KEYCODE_X        = $32;
  76.     KEYCODE_N        = $36;
  77.     KEYCODE_M        = $37;
  78.     
  79. type
  80.  
  81.     IntuiMessage = record
  82.     ExecMessage : Message;
  83.     Class    : Integer;
  84.     Code    : Short;
  85.     Qualifier : Short;
  86.     IAddress : Address;
  87.     MouseX,
  88.     MouseY    : Short;
  89.     Seconds,
  90.     Micros    : Integer;
  91.     IDCMPWindow : Address;
  92.     SpecialLink : ^IntuiMessage;
  93.     end;
  94.     IntuiMessagePtr = ^IntuiMessage;
  95.  
  96.     IntuiText = record
  97.     FrontPen,
  98.     Backpen,
  99.     DrawMode,
  100.     KludgeFill  : Byte; { Kludge is just a reminder here }
  101.     LeftEdge,
  102.     TopEdge     : Short;
  103.     ITextFont   : Address;
  104.     IText       : String;
  105.     NextText    : ^IntuiText;
  106.     end;
  107.     IntuiTextPtr = ^IntuiText;
  108.  
  109.     Image = record
  110.     LeftEdge,
  111.     TopEdge,
  112.     Width,
  113.     Height,
  114.     Depth    : Short;
  115.     ImageData: Address;
  116.     PlanePick,
  117.     PlaneOnOff : Byte;
  118.     NextImage  : ^Image;
  119.     end;
  120.     ImagePtr = ^Image;
  121.  
  122.     Border = record
  123.     LeftEdge,
  124.     TopEdge    : Short;
  125.     FrontPen,
  126.     BackPen,
  127.     DrawMode,
  128.     Count    : Byte;
  129.     XY     : Address;
  130.     NextBorder : ^Border;
  131.     end;
  132.     BorderPtr = ^Border;
  133.  
  134.    { ItemFlags }
  135. const
  136.     { Flags set by the application }
  137.     CheckIt    = $0001;
  138.     ItemText    = $0002;
  139.     CommSeq    = $0004;
  140.     MenuToggle    = $0008;
  141.     ItemEnabled    = $0010;
  142.  
  143. { The special highlight flag state meanings }
  144.  
  145.     HighFlags    = $00C0;    { see definitions below }
  146.     HighImage    = $0000;    { use the "select image" }
  147.     HighComp    = $0040;    { complement the select box }
  148.     HighBox    = $0080;    { draw a box around select box to highlight }
  149.     HighNone    = $00C0;    { don't highlight }
  150.  
  151. { Flag set by both application and Intuition }
  152.  
  153.     Checked    = $0100;    { if CheckIt is set, then this => selected }
  154.  
  155. { Flags set by Intuition }
  156.  
  157.     IsDrawn    = $1000;    { this item's subitems are drawn }
  158.     HighItem    = $2000;    { this item is highlighted }
  159.     MenuToggled    = $4000;    { this item was already toggled }
  160.  
  161. type
  162.     MenuItem = record
  163.     NextItem    : ^MenuItem;
  164.     LeftEdge,
  165.     TopEdge,
  166.     Width,
  167.     Height        : Short;    { select box dimensions }
  168.     Flags        : Short;    { see constants above }
  169.     MutualExclude    : Integer;
  170.     ItemFill    : Address;    { Image, IntuiText, or Null }
  171.     SelectFill    : Address;    { Image, IntuiText, or Null }
  172.     Command        : Byte;        { if CommSeq is set }
  173.     SubItem        : ^MenuItem;
  174.     NextSelect    : Short;    { Menu # of next selected item }
  175.     end;
  176.     MenuItemPtr = ^MenuItem;
  177.  
  178.     Menu = record
  179.     NextMenu    : ^Menu;    { same level }
  180.     LeftEdge,            { position of the select box }
  181.     TopEdge,
  182.     Width,
  183.     Height        : Short;
  184.     Flags        : Short;    { see flags above }
  185.     MenuName    : String;    { text for menu header }
  186.     FirstItem    : MenuItemPtr;    { first item in chain }
  187.     JazzX,
  188.     JazzY,
  189.     BeatX,
  190.     BeatY        : Short;    { for internal use }
  191.     end;
  192.     MenuPtr = ^Menu;
  193.  
  194.     NewScreen = record
  195.     LeftEdge,
  196.     TopEdge,
  197.     Width,
  198.     Height,
  199.     Depth    : Short;
  200.     DetailPen,
  201.     BlockPen : Byte;
  202.     ViewModes : Short;
  203.     SType      : Short;    { Normally this is called 'Type', but }
  204.     Font      : Address;    { since that's a reserved word I had  }
  205.     DefaultTitle : String;    { change it                  }
  206.     Gadgets      : Address;
  207.     CustomBitMap : Address;
  208.     end;
  209.     NewScreenPtr = ^NewScreen;
  210.     ScreenPtr = Address;
  211.  
  212.     NewWindow = record
  213.     LeftEdge,
  214.     TopEdge,
  215.     Width,
  216.     Height        : Short;
  217.     DetailPen,
  218.     BlockPen    : Byte;
  219.     IDCMPFlags    : Integer;
  220.     Flags        : Integer;
  221.     FirstGadget    : Address;
  222.     CheckMark    : Address;
  223.     Title        : String;
  224.     Screen        : ScreenPtr;
  225.     BitMap        : Address;
  226.     MinWidth,
  227.     MinHeight,
  228.     MaxWidth,
  229.     MaxHeight    : Short;
  230.     WType        : Short; { This also had to be changed }
  231.     end;
  232.     NewWindowPtr = ^NewWindow;
  233.  
  234.     Window = record
  235.     NextWindow    : ^Window;
  236.     LeftEdge,
  237.     TopEdge,
  238.     Width,
  239.     Height        : Short;
  240.     MouseY,
  241.     MouseX        : Short;
  242.     MinWidth,
  243.     MinHeight,
  244.     MaxWidth,
  245.     MaxHeight    : Short;
  246.     Flags        : Integer;
  247.     MenuStrip    : MenuPtr;
  248.     Title        : String;
  249.     FirstRequest    : Address;
  250.     DMRequest    : Address;
  251.     ReqCount    : Short;
  252.     WScreen        : ScreenPtr;
  253.     RPort        : Address;
  254.     BorderLeft,
  255.     BorderTop,
  256.     BorderRight,
  257.     BorderBottom    : Byte;
  258.     BorderRPort    : Address;
  259.     FirstGadget    : Address;
  260.     Parent,
  261.     Descendant    : ^Window;
  262.     Pointer        : Address;
  263.     PtrHeight,
  264.     PtrWidth    : Byte;
  265.     XOffset,
  266.     YOffset        : Byte;
  267.     IDCMPFlags    : Integer;
  268.     UserPort,
  269.     WindowPort    : Address;
  270.     MessageKey    : Address;
  271.     DetailPen,
  272.     BlockPen    : Byte;
  273.     CheckMark    : Address;
  274.     ScreenTitle    : String;
  275.     GZZMouseX,
  276.     GZZMouseY,
  277.     GZZWidth,
  278.     GZZHeight    : Short;
  279.     ExtData        : Address;
  280.     UserData    : Integer;
  281.     WLayer        : Address;
  282.     IFont        : Address;
  283.     end;
  284.     WindowPtr = ^Window;
  285.  
  286.  
  287. Function AddGadget(w : WindowPtr; g : Address; p : Integer) : Integer;
  288.     External;
  289. Function AllocRemember(r : Address; s, f : Integer) : Address;
  290.     External;
  291. Function AutoRequest(w : WindowPtr; b, p, n : IntuiTextPtr;
  292.             pf, nf, x, y : Integer) : Boolean;
  293.     External;
  294. Procedure BeginRefresh(w : WindowPtr);
  295.     External;
  296. Function BuildSysRequest(w : WindowPtr; b, p, n : IntuiTextPtr;
  297.             f, x, y : Integer) : Address;
  298.     External;
  299. Function ClearDMRequest(w : WindowPtr) : Boolean;
  300.     External;
  301. Procedure ClearMenuStrip(w : WindowPtr);
  302.     External;
  303. Procedure ClearPointer(w : WindowPtr);
  304.     External;
  305. Procedure CloseScreen(s : ScreenPtr);
  306.     External;
  307. Procedure CloseWindow(w : WindowPtr);
  308.     External;
  309. Function CloseWorkBench() : Boolean;
  310.     External;
  311. Procedure CurrentTime(var s, m : Integer);
  312.     External;
  313. { Note the use of VAR above to do the same work as the & (address)
  314.   prefix in C. }
  315. Function DisplayAlert(n : Integer; s: String; h: Integer): Boolean;
  316.     External;
  317. Procedure DisplayBeep(s : ScreenPtr);
  318.     External;
  319. Function DoubleClick(ss, sm, cs, cm : Integer) : Boolean;
  320.     External;
  321. Procedure DrawBorder(r : Address; b : BorderPtr; x, y : Integer);
  322.     External;
  323. Procedure DrawImage(r : Address; i : ImagePtr; x, y : Integer);
  324.     External;
  325. Procedure EndRefresh(w : WindowPtr; c : Boolean);
  326.     External;
  327. Procedure EndRequest(r : Address; w : WindowPtr);
  328.     External;
  329. Procedure FreeRemember(k : Address; r : Boolean);
  330.     External;
  331. Procedure FreeSysRequest(w : WindowPtr);
  332.     External;
  333. Function GetDefPrefs(p : Address; s : Integer) : Address;
  334.     External;
  335. Function GetPrefs(p : Address; s : Integer) : Address;
  336.     External;
  337. Procedure InitRequester(r : Address);
  338.     External;
  339. Function IntuiTextLength(i : IntuiTextPtr) : Integer;
  340.     External;
  341. Function ItemAddress(m : MenuPtr; n : Integer) : MenuItemPtr;
  342.     External;
  343. Procedure MakeScreen(s : ScreenPtr);
  344.     External;
  345. Procedure ModifyIDCMP(w : WindowPtr; i : Integer);
  346.     External;
  347. Procedure ModifyProp(p : Address; w : WindowPtr; r : Address;
  348.             f, hp, vp, hb, vb : Integer);
  349.     External;
  350. Procedure MoveScreen(s : ScreenPtr; x, y : Integer);
  351.     External;
  352. Procedure MoveWindow(w : WindowPtr; x, y : Integer);
  353.     External;
  354. Procedure OffGadget(g : Address; w : WindowPtr; r : Address);
  355.     External;
  356. Procedure OffMenu(w : WindowPtr; n : Integer);
  357.     External;
  358. Procedure OnGadget(g : Address; w : WindowPtr; r : Address);
  359.     External;
  360. Procedure OnMenu(w : WindowPtr; n : Integer);
  361.     External;
  362. Function OpenScreen(ns : NewScreenPtr) : ScreenPtr;
  363.     External;
  364. Function OpenWindow(nw : NewWindowPtr): WindowPtr;
  365.     External;
  366. Function OpenWorkBench() : Boolean;
  367.     External;
  368. Procedure PrintIText(r : Address; i : IntuiTextPtr; x, y : Integer);
  369.     External;
  370. Procedure RefreshGadgets(g : Address; w : WindowPtr; r : Address);
  371.     External;
  372. Procedure RemakeDisplay;
  373.     External;
  374. Function RemoveGadget(w : WindowPtr; g : Address) : Integer;
  375.     External;
  376. Procedure ReportMouse(w : WindowPtr; b : Boolean);
  377.     External;
  378. Function Request(r : Address; w : WindowPtr) : Boolean;
  379.     External;
  380. Procedure RethinkDisplay;
  381.     External;
  382. Procedure ScreenToBack(s : ScreenPtr);
  383.     External;
  384. Procedure ScreenToFront(s : ScreenPtr);
  385.     External;
  386. Function SetDMRequest(w : WindowPtr; r : Address) : Boolean;
  387.     External;
  388. Procedure SetMenuStrip(w : WindowPtr; m : MenuPtr);
  389.     External;
  390. Procedure SetPointer(w : WindowPtr; p : Address; ys, xs, xo, yo : Integer);
  391.     External;
  392. Procedure SetWindowTitles(w : WindowPtr; t, s : String);
  393.     External;
  394. Procedure ShowTitle(s : ScreenPtr; b : Boolean);
  395.     External;
  396. Procedure SizeWindow(w : WindowPtr; x, y : Integer);
  397.     External;
  398. Function ViewAddress() : Address;
  399.     External;
  400. Function ViewPortAddress(w : WindowPtr): Address;
  401.     External;
  402. Procedure WBenchToBack;
  403.     External;
  404. Procedure WBenchToFront;
  405.     External;
  406. Function WindowLimits(w : WindowPtr; mx, my, nx, ny : Integer): Boolean;
  407.     External;
  408. Procedure WindowToBack(w : WindowPtr);
  409.     External;
  410. Procedure WindowToFront(w : WindowPtr);
  411.     External;
  412.